Existing smartphones, such as a cell phone with an Android system, often need to upgrade software. Generally, a FOTA (Firmware Over-The-Air) upgrade is used. The FOTA upgrade is a simple and friendly upgrade method, which can upgrade the cell phone software to the latest version almost without asking a user to carry out any operation. Given the current tendency that the development of smartphones is fast, however, there are often situations in which a memory partition table of a cell phone needs to be revised due to the software version upgrade (or changes to software requirements). The existing FOTA mechanism is unable to handle this type of situations.
Specifically in the field of mobile terminals and the entire embedded field, with a cell phone as an example, there are typically two types of storage media, one type of storage media is cell phone memory, which is typically a NAND or EMMC and is a core storage space for the cell phone. The second type of storage media is expanded memory, which is typically a SD card.
There are two types of cell phone memory partitions (the term “partition” as used hereinafter refers in particular to a cell phone memory partition, and the term “partition table” refers in particular to a partition table of a cell phone memory). One type of cell phone memory partition is a raw data type, i.e. writing and reading data in a form of a raw data stream, and this type of partition includes bootloader, kernel, etc. The other type of cell phone memory partition is a filesystem type. The term “file” herein means computer file, which refers to a set of some data. One file represents a set of data. In this type of partition, a file system (e.g. EXT4 or FAT) is deployed to manage all files. If a file needs to be read or written, a reading or writing mode of the file system is written. On a typical cell phone apparatus, both a system partition and a userdata partition belong to this type. Figuratively, the filesystem type partition is like a book having a table of contents. The table of contents is META data in the partition regarding a file list, file attributes, and a file size.
On the other hand, the raw data type partition is like a book without a table of contents. According to the actual situation of a cell phone (embedded) field, it can be simply summarized that the raw data type partition may store one file, and the filesystem type partition may store multiple files. As described above, each partition has a conventional type, and therefore, the partition type will usually not change.
Given that development of smartphones is fast, however, there are often situations in which a memory partition table of a cell phone needs to be revised due to a software version upgrade (or changes to software requirements). Changes to a partition table include changes to a starting address and changes to a size of the associated partitions. Such changes to the starting address and to the size of the partitions are fatal to a filesystem type partition, as this type of change may corrupt META data. Once the META data is corrupted, some files in the partition cannot be read or written. Although a raw data type partition does not have META data, this type of change may still corrupt data in the partition.
Moreover, the FOTA mechanism is based on a file differential algorithm and all of its operations are file operations. In the event that files are corrupted, the FOTA operations will certainly fail. Furthermore, the existing FOTA mechanism does not provide relevant measures for “changes to a partition table of a memory between new and old versions of the software”. As a result, the existing FOTA mechanism is unable to process this type of situations. Since the existing FOTA upgrade method cannot handle this type of situations, it will make the development more difficult if the original partition table has to be kept, and moreover, users will not be able to have the latest and the best user experience.
Therefore, the prior art still needs to be improved and developed.